3.295 \(\int (a+b \sin ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=72 \[ \frac {1}{8} x \left (8 a^2+8 a b+3 b^2\right )-\frac {b (8 a+3 b) \sin (e+f x) \cos (e+f x)}{8 f}-\frac {b^2 \sin ^3(e+f x) \cos (e+f x)}{4 f} \]

[Out]

1/8*(8*a^2+8*a*b+3*b^2)*x-1/8*b*(8*a+3*b)*cos(f*x+e)*sin(f*x+e)/f-1/4*b^2*cos(f*x+e)*sin(f*x+e)^3/f

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.071, Rules used = {3179} \[ \frac {1}{8} x \left (8 a^2+8 a b+3 b^2\right )-\frac {b (8 a+3 b) \sin (e+f x) \cos (e+f x)}{8 f}-\frac {b^2 \sin ^3(e+f x) \cos (e+f x)}{4 f} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[e + f*x]^2)^2,x]

[Out]

((8*a^2 + 8*a*b + 3*b^2)*x)/8 - (b*(8*a + 3*b)*Cos[e + f*x]*Sin[e + f*x])/(8*f) - (b^2*Cos[e + f*x]*Sin[e + f*
x]^3)/(4*f)

Rule 3179

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^2, x_Symbol] :> Simp[((8*a^2 + 8*a*b + 3*b^2)*x)/8, x] + (-Simp[(
b^2*Cos[e + f*x]*Sin[e + f*x]^3)/(4*f), x] - Simp[(b*(8*a + 3*b)*Cos[e + f*x]*Sin[e + f*x])/(8*f), x]) /; Free
Q[{a, b, e, f}, x]

Rubi steps

\begin {align*} \int \left (a+b \sin ^2(e+f x)\right )^2 \, dx &=\frac {1}{8} \left (8 a^2+8 a b+3 b^2\right ) x-\frac {b (8 a+3 b) \cos (e+f x) \sin (e+f x)}{8 f}-\frac {b^2 \cos (e+f x) \sin ^3(e+f x)}{4 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.12, size = 58, normalized size = 0.81 \[ \frac {4 \left (8 a^2+8 a b+3 b^2\right ) (e+f x)-8 b (2 a+b) \sin (2 (e+f x))+b^2 \sin (4 (e+f x))}{32 f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[e + f*x]^2)^2,x]

[Out]

(4*(8*a^2 + 8*a*b + 3*b^2)*(e + f*x) - 8*b*(2*a + b)*Sin[2*(e + f*x)] + b^2*Sin[4*(e + f*x)])/(32*f)

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 63, normalized size = 0.88 \[ \frac {{\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} f x + {\left (2 \, b^{2} \cos \left (f x + e\right )^{3} - {\left (8 \, a b + 5 \, b^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{8 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/8*((8*a^2 + 8*a*b + 3*b^2)*f*x + (2*b^2*cos(f*x + e)^3 - (8*a*b + 5*b^2)*cos(f*x + e))*sin(f*x + e))/f

________________________________________________________________________________________

giac [A]  time = 0.13, size = 60, normalized size = 0.83 \[ \frac {1}{8} \, {\left (8 \, a^{2} + 8 \, a b + 3 \, b^{2}\right )} x + \frac {b^{2} \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} - \frac {{\left (2 \, a b + b^{2}\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/8*(8*a^2 + 8*a*b + 3*b^2)*x + 1/32*b^2*sin(4*f*x + 4*e)/f - 1/4*(2*a*b + b^2)*sin(2*f*x + 2*e)/f

________________________________________________________________________________________

maple [A]  time = 0.35, size = 78, normalized size = 1.08 \[ \frac {b^{2} \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )+2 a b \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+a^{2} \left (f x +e \right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(f*x+e)^2)^2,x)

[Out]

1/f*(b^2*(-1/4*(sin(f*x+e)^3+3/2*sin(f*x+e))*cos(f*x+e)+3/8*f*x+3/8*e)+2*a*b*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f
*x+1/2*e)+a^2*(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.32, size = 68, normalized size = 0.94 \[ a^{2} x + \frac {{\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a b}{2 \, f} + \frac {{\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} b^{2}}{32 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

a^2*x + 1/2*(2*f*x + 2*e - sin(2*f*x + 2*e))*a*b/f + 1/32*(12*f*x + 12*e + sin(4*f*x + 4*e) - 8*sin(2*f*x + 2*
e))*b^2/f

________________________________________________________________________________________

mupad [B]  time = 14.49, size = 77, normalized size = 1.07 \[ x\,\left (a^2+a\,b+\frac {3\,b^2}{8}\right )-\frac {\left (\frac {5\,b^2}{8}+a\,b\right )\,{\mathrm {tan}\left (e+f\,x\right )}^3+\left (\frac {3\,b^2}{8}+a\,b\right )\,\mathrm {tan}\left (e+f\,x\right )}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^4+2\,{\mathrm {tan}\left (e+f\,x\right )}^2+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(e + f*x)^2)^2,x)

[Out]

x*(a*b + a^2 + (3*b^2)/8) - (tan(e + f*x)*(a*b + (3*b^2)/8) + tan(e + f*x)^3*(a*b + (5*b^2)/8))/(f*(2*tan(e +
f*x)^2 + tan(e + f*x)^4 + 1))

________________________________________________________________________________________

sympy [A]  time = 1.34, size = 168, normalized size = 2.33 \[ \begin {cases} a^{2} x + a b x \sin ^{2}{\left (e + f x \right )} + a b x \cos ^{2}{\left (e + f x \right )} - \frac {a b \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} + \frac {3 b^{2} x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {3 b^{2} x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {3 b^{2} x \cos ^{4}{\left (e + f x \right )}}{8} - \frac {5 b^{2} \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {3 b^{2} \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin ^{2}{\relax (e )}\right )^{2} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(f*x+e)**2)**2,x)

[Out]

Piecewise((a**2*x + a*b*x*sin(e + f*x)**2 + a*b*x*cos(e + f*x)**2 - a*b*sin(e + f*x)*cos(e + f*x)/f + 3*b**2*x
*sin(e + f*x)**4/8 + 3*b**2*x*sin(e + f*x)**2*cos(e + f*x)**2/4 + 3*b**2*x*cos(e + f*x)**4/8 - 5*b**2*sin(e +
f*x)**3*cos(e + f*x)/(8*f) - 3*b**2*sin(e + f*x)*cos(e + f*x)**3/(8*f), Ne(f, 0)), (x*(a + b*sin(e)**2)**2, Tr
ue))

________________________________________________________________________________________